home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1118 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.8 KB

  1. Date: Thu, 3 Mar 94 07:26:44 PST
  2. From: hyc@hanauma.jpl.nasa.gov (Howard Chu)
  3. Message-Id: <9403031526.AA20623@hanauma.jpl.nasa.gov>
  4. To: mint@atari.archive.umich.edu
  5. Subject: select
  6.  
  7. Ah, I'm an idiot. Or I've been up too many days straight. Must be an idiot to
  8. have done that, too... Anyway, here's checkbttys in bios.c again, this time
  9. it doesn't kill itself by walking off the end of the array. (Wouldn't you
  10. know, I had defined and set the maximum counter value before, but never
  11. referenced it. sheesh...)
  12. --- 1.2    1994/03/02 08:06:50
  13. +++ bios.c    1994/03/03 06:01:10
  14. @@ -21,8 +21,9 @@
  15.  /* BIOS device definitions */
  16.  #define CONSDEV 2
  17.  #define AUXDEV 1
  18.  #define PRNDEV 0
  19. +#define    SERDEV 6    /* First serial port */
  20.  
  21.  /* BIOS devices 0..MAX_BHANDLE-1 can be redirected to GEMDOS files */
  22.  #define MAX_BHANDLE    4
  23.  
  24. @@ -31,8 +32,10 @@
  25.  const short boutput[MAX_BHANDLE] = { -3, -2, -1, -5 };
  26.  
  27.  /* tty structures for the BIOS devices -- see biosfs.c */
  28.  extern struct tty con_tty, aux_tty, midi_tty;
  29. +extern struct bios_tty bttys[];
  30. +extern short btty_max;
  31.  
  32.  extern int tosvers;    /* from main.c */
  33.  
  34.  char *kbshft;        /* set in main.c */
  35. @@ -94,8 +97,31 @@
  36.      DEBUG(("failed call to Getmpb"));
  37.      return -1;
  38.  }
  39.  
  40. +void
  41. +checkbttys(void)
  42. +{
  43. +    struct bios_tty *b;
  44. +    long *l;
  45. +
  46. +    for (b=bttys;b<bttys+btty_max;b++) {
  47. +        if (b->irec->head != b->irec->tail) {
  48. +            wake(IO_Q, (long)b);
  49. +            l = b->rsel;
  50. +            if (*l)
  51. +                wakeselect(*l);
  52. +        }
  53. +        l = b->wsel;
  54. +        if (*l) {
  55. +            short i = b->orec->tail - b->orec->head;
  56. +            if (i < 0)
  57. +                i += b->orec->buflen;
  58. +            if (i < b->orec->hi_water)
  59. +                wakeselect(*l);
  60. +        }
  61. +    }
  62. +}
  63.  
  64.  /*
  65.   * Note that BIOS handles 0 - MAX_BHANDLE now reference file handles;
  66.   * to get the physical devices, go through u:\dev\
  67. @@ -179,12 +205,21 @@
  68.          k->head = h;
  69.          return r;
  70.      }
  71.      else {
  72. -        if (dev == AUXDEV && has_bconmap)
  73. -            dev = curproc->bconmap;
  74. -
  75. -        if (dev > 0) {
  76. +        if (dev == AUXDEV) {
  77. +            if (has_bconmap) {
  78. +                dev = curproc->bconmap;
  79. +                h = dev-SERDEV;
  80. +            } else
  81. +                h = 0;
  82. +        } else
  83. +            h = dev-SERDEV;
  84. +
  85. +        if (h >= 0 && h < btty_max) {
  86. +            if (!BCONSTAT(dev))
  87. +                sleep(IO_Q, (long)&bttys[h]);
  88. +        } else if (dev > 0) {
  89.              unsigned long tick;
  90.  
  91.              tick = *((unsigned long *)0x4baL);
  92.              while (!BCONSTAT(dev)) {
  93.  
  94. There's only one thing I don't like about it at the moment; if you try to
  95. just use "aux:" without first Bconmap'ing it to somewhere else you get stuck
  96. with a non-selectable non-tty... I figure it ought to give you modem1, and
  97. act like a tty, by default. [This doesn't seem to be a problem on systems
  98. that don't support bconmap...]
  99.  
  100. Say, is anyone else out there using the Atari debugger? Is version 4 the
  101. latest? I have a version 4 binary, and a bunch of files for the version 3
  102. release. I only have a v4 db though, not the rdb. The version 3 rdb doesn't
  103. like running under MultiTOS. (dunno why not, all it has to do is watch the
  104. MIDI ports. sheesh.)
  105.